<!DOCTYPE html>
<html>
<head>
        <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
        <meta charset="utf-8">
        <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
        <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
        <link rel="stylesheet" type="text/css" href="../../css/aui.css">
        <link rel="stylesheet" type="text/css" href="../../css/aui-slide.css">
        <link rel="stylesheet" type="text/css" href="../../css/api.css">
        <link rel="stylesheet" type="text/css" href="../../font-icon/demo.css">
        <link rel="stylesheet" type="text/css" href="../../font-icon/iconfont.css">
        <script type="text/javascript" src="../../script/api.js"></script>
    
        <script src="../../script/TouchSlide.1.1.js"></script>
        <link rel="stylesheet" type="text/css" href="../../css/aui.css">
    <style>
        html {
            height: 100%;
            width: 100%;
            display: table;
            font-size: 70%
        }

        body {
            display: table-cell;
            width: 100%;
            height: 100%;
        }
        ul{
            margin: 0;
            padding: 0;
        }
        li{
            list-style: none;
        }
        .all{
            height: 100%;
            width: 100%;
        }
        .top{
            position: relative;
            background-color: #f7911b;
            height: 7.68% ;
            min-height: 3.8rem;
            width: 100%;
            text-align: center;
        }
        .back{
            font-size: 2rem;
            color: white;
            left: 0.66rem;
            line-height: 4.5rem;
            position: absolute;
        }
        .title{
            font-size: 2rem;
            color: white;
            line-height: 4.2rem;
        }
        .main{
            position: absolute;
            height: 92.32%;
            width: 100%;
            background-color: #f6f6f6;
            overflow: auto;
        }
        .top_slide_nav{
            width: 100%;
            height: 10%;
            background-color: white;
        }
        .left_nav_btn{
            width: 15%;
            height: 100%;
            float: left;
        }
        .left_nav_btn img{
            width: 2.3rem;
            height: 1.7rem;
            float: left;
            margin-left: 1.5rem;
            margin-top: 1.5rem;
            opacity: 0.7;
        }
        .mid_hide_box{
            width: 70%;
            height: 100%;
            float: left;
            overflow-y: auto;
        }
        .mid_real_box{
            white-space: nowrap;
            height: 100%;
            float: left;
        }

        .mid_real_box ul li{
           margin-right: 2rem;
            height: 100%;
            display:inline-block;
            font-size: 1.2rem;
            text-align: left;
            line-height: 5rem;
            font-weight:bold;
        }
        .right_select_btn{
            width: 15%;
            height: 100%;
            float: left;
        }
        .right_select_btn img{
            width: 1.9rem;
            height: 1.3rem;
            float: right;
            margin-right: 1.5rem;
            margin-top: 1.7rem;
            opacity: 0.5;
        }
        .content{
            width: 100%;
            position: absolute;
            height: 90%;
            overflow-x: auto;
        }
        .left_nav{
            height: 100%;
            width: 35%;
            background-color: white;
            position:fixed;
            left: -35%;
            -moz-box-shadow:0px 0px 0.5rem #eeeeee; -webkit-box-shadow:0px 0px 0.5rem #eeeeee; box-shadow:0px 0px 0.5rem #eeeeee;
        }
        .left_nav .nav_li_1{
            height: 4rem;
            width: 100%;
            display: block;
            border-top: 0.1rem solid #eeeeee;
            overflow: hidden;
        }
        .left_nav .nav_li_1 span{
            height: 4rem;
            width: 100%;
            font-size: 1.5rem;
            display: block;
            line-height: 4rem;
            text-indent:2rem;
            color: #333333;
        }
        .left_nav .on span{
            background-color: #ff8400;
            color: white;
        }
        .left_nav .nav_li_1 li{
            height: 3rem;
            width: 100%;
            line-height: 3rem;
            display: block;
            font-size: 1.3rem;
            color: #999999;
            text-indent:2rem;

        }
        .left_nav .nav_li_1 .on1{
            color: #f7911b;
        }
        .dd{
            height: 100%;
            width: 65%;
            position:fixed;
            display: none;
        }
        .display_box{
            position: absolute;
            top: 0rem;
            width: 100%;
            height: 70%;
            z-index: 1000;
            display: none;
            overflow: hidden;
        }
        .type_main_box{
            position: relative;
            width: 100%;
            height: 100%;
            top: -100%;
        }
        .click_box{
            position: absolute;
            bottom: 0rem;
            width: 100%;
            height: 30%;
            z-index: 1000;
            display: none;
        }
        .top_click{
            width: 100%;
            text-align: right;
            background-color: white;
        }
        .top_click span{
            font-size: 1.4rem;
            color: #999999;
            float: left;
            height: 100%;
            display: block;
            line-height: 5rem;
            margin-left: 1rem;
        }
        .top_click img{
            transform:rotate(180deg);
            -ms-transform:rotate(180deg); 	/* IE 9 */
            -moz-transform:rotate(180deg); 	/* Firefox */
            -webkit-transform:rotate(180deg); /* Safari 和 Chrome */
            -o-transform:rotate(180deg);
            width: 1.9rem;
            height: 1.3rem;
            margin-right: 1.5rem;
            margin-top: 1.7rem;
            opacity: 0.7;
            display:unset;
        }
        .type_main{
            width: 100%;
            background-color: white;
            height: 28rem;
            border-bottom: solid 0.1rem #999999;
        }
        .type_main ul{
            width: 97%;
            margin-left: 8%;
        }
        .type_main ul li{
            float: left;
            display: block;
            width: 9rem;
            font-size: 1.3rem;
            height: 4rem;
            text-align: center;
            border: 0.05rem solid #cccccc;
            line-height: 4rem;
            color: #666666;
        }
        .type_main_scroll{
            width: 100%;
            height: 24rem;
            overflow-x: auto;
            
           
          
        }
        .content_box{
            height: auto;
            width: 95%;
            margin: auto;
        }
        .item_box{
            width: 50%;
            height: 25rem;
            padding: 0.5rem;
            float: left;
        }
        .content_item{
            width: 100%;
            height: 100%;
            background-color: #fff;
            border-radius: 1rem;
           
        }
        .content_text_box{
            width: 100%;
            height: 35%;
            background-color: white;
            border-bottom-left-radius: 1rem;
            border-bottom-right-radius: 1rem;
        }
        .content_img{
           
            height: 65%;
            width: 100%;
            border-top-left-radius: 1rem;
            border-top-right-radius: 1rem;
            overflow: hidden;
           
          display: flex;
          justify-content: center;
          align-items: center;
        }
     
        .content_title{
            width: 90%;
            margin: auto;
            font-size: 1.3rem;
            color: #333333;
            font-weight: bold;
            display: block;
            height: 4.5rem;
            padding-top: 1rem;
            line-height: 1.7rem;
            overflow:hidden;
    text-overflow:ellipsis;
    white-space:wrap
        }
        .content_price{
            float: left;
            font-size: 1.5rem;
            font-weight: bold;
            color: orangered;
            margin-left: 0.5rem;
            margin-top: 1.8rem;
        }
        .content_num{
            font-size: 1.2rem;
            color: #999999;
            float: right;
            margin-right: 1rem;
            margin-top: 2.1rem;
        }
        
    </style>
</head>
<body>
<div class="all">
    <div class="top">
        <span class="aui-iconfont aui-icon-left" style="float: left;font-size: 2rem;line-height: 4.2rem;" onclick="api.closeWin();"></span>
        <span class="title">分类</span>
    </div>
    <div class="main">
        <div class="display_box">
            <div class="type_main_box">
                <div class="top_click">
                    <span>请选择分类</span>
                    <img src="../../image/right_sel.png" />
                </div>
                <div class="type_main">
                    <div class="type_main_scroll">
                        <ul id="select_itme">
                            <li>qq</li>
                            <li>口腔护理</li>
                            <li>女性护理</li>
                            <li>身体护理</li>
                            <li>个人护理</li>
                            <li>面部护理</li>
                            <li>面部护理</li>
                            <li>口腔护理</li>
                            <li>女性护理</li>
                            <li>身体护理</li>
                            <li>个人护理</li>
                            <li>面部护理</li>
                            <li>面部护理</li>
                            <li>口腔护理</li>
                            <li>女性护理</li>
                            <li>身体护理</li>
                            <li>个人护理</li>
                            <li>面部护理</li>

                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="click_box"></div>
        <div class="top_slide_nav">
            <div class="left_nav_btn">
                <img src="../../image/left_nav.png" />
            </div>
            <div class="mid_hide_box">
                <div class="mid_real_box">
                    <ul id="top_api">
                        <!-- <li  >面aaa护理</li>
                        <li style="font-size:1.5rem;color: #f7911b;">口腔护理</li>
                        <li>女性护理</li>
                        <li>身体护理</li>
                        <li>个人护理</li>
                        <li>面部护理</li> -->
                    </ul>
                </div>
            </div>
            <div class="right_select_btn">
                <img src="../../image/right_sel.png" />
            </div>
        </div>
        <div class="content">
            <div class="left_nav" >
                <ul id="left_nav">

                    <!-- <li class="on nav_li_1">
                        <span>彩妆</span>
                        <ul>
                            <li class="on1">彩妆</li>
                            <li>彩妆</li>
                            <li>彩妆</li>
                            <li>彩妆</li>
                            <li>彩妆</li>
                        </ul>
                    </li>

                    <li class="nav_li_1">
                        <span>彩妆</span>
                        <ul>
                            <li class="on1">彩妆</li>
                            <li>彩妆</li>
                            <li>彩妆</li>
                            <li>彩妆</li>
                            <li>彩妆</li>
                        </ul>
                    </li>
                    <li class="nav_li_1">
                        <span>彩妆</span>
                        <ul>
                            <li class="on1">彩妆</li>
                            <li>彩妆</li>
                            <li>彩妆</li>
                            <li>彩妆</li>
                            <li>彩妆</li>
                        </ul>
                    </li>
                    <li class="nav_li_1">
                            <span>ssssssss</span>
                            <ul>
                                <li class="on1">彩妆</li>
                                <li>彩妆</li>
                                <li>彩妆</li>
                                <li>彩妆</li>
                                <li>彩妆</li>
                            </ul>
                        </li> -->
                </ul>
            </div>
            <div class="dd"></div>
            <div class="content_box" id="content_box">
                <!-- <div class="item_box">
                    <div class="content_item">
                        <div class="content_img"></div>
                        <div class="content_text_box">
                            <span class="content_title">优萃佳颜舒润保湿面膜</span>
                            <span class="content_price">￥17.5</span>
                            <span class="content_num">1557人买过</span>
                        </div>
                    </div>
                </div>
                <div class="item_box">
                    <div class="content_item">
                        <div class="content_img"></div>
                        <div class="content_text_box">
                            <span class="content_title">优萃佳颜舒润保湿面膜</span>
                            <span class="content_price">￥17.5</span>
                            <span class="content_num">1557人买过</span>
                        </div>
                    </div>
                </div>
                <div class="item_box">
                    <div class="content_item">
                        <div class="content_img"></div>
                        <div class="content_text_box">
                            <span class="content_title">优萃佳颜舒润保湿面膜</span>
                            <span class="content_price">￥17.5</span>
                            <span class="content_num">1557人买过</span>
                        </div>
                    </div>
                </div>
                

                <div class="item_box">
                    <div class="content_item">
                        <div class="content_img"></div>
                        <div class="content_text_box">
                            <span class="content_title">优萃佳颜舒润保湿面膜</span>
                            <span class="content_price">￥17.5</span>
                            <span class="content_num">1557人买过</span>
                        </div>
                    </div>
                </div>
 -->


            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
  $('.left_nav_btn img').click(function(){
        $('.left_nav').animate({left:'0%'},function(){
            $('.dd').css({'display':'block','left':'35%'});
            $('.dd').addClass('clk');
            $('.left_nav_btn img').addClass('clk');
        });  
    })
    $('body').on('click','.clk',function(){
        $('.left_nav').animate({left:'-35%'},function(){
            $('.dd').css({'display':'none','left':'0%'});
            $('.dd').removeClass('clk');
            $('.left_nav_btn img').removeClass('clk');
        });  
    })
    $('.mid_real_box ul li').click(function(){
        $(this).animate({fontSize:'1.5rem'},'fast')
        $(this).css('color','#f7911b')
        $('.mid_real_box ul li').not(this).animate({fontSize:'1.2rem'},'fast')
        $('.mid_real_box ul li').not(this).css('color','#666666')
    })
    $('.right_select_btn img').click(function(){
        $('.click_box').css('display','block');
        $('.display_box').css('display','block');
        $('.type_main_box').animate({top:'0'})
        $('.left_nav').animate({left:'-35%'},function(){
            $('.dd').css({'display':'none','left':'0%'});
            $('.dd').removeClass('clk');
            $('.left_nav_btn img').removeClass('clk');
        });  
    })
    $('.click_box').click(function(){
        $('.click_box').css('display','none');
        $('.type_main_box').animate({top:'-100%'},function(){
            $('.display_box').css('display','none');
        })
    })
    $('.top_click img').click(function(){
        $('.click_box').css('display','none');
        $('.type_main_box').animate({top:'-100%'},function(){
            $('.display_box').css('display','none');
        })
    })
    $('body').on('click','.nav_li_1',function(){
        var height1 = Number($(this).find('ul li').length)*3+4;
        $('.nav_li_1').not(this).animate({height:'4rem'},300)
        $(this).animate({height:height1+'rem'},300)
        $('.nav_li_1').not(this).removeClass('on');
        $(this).addClass('on');
       
    })
    $('body').on('click','.nav_li_1 ul li',function(){
        $('.nav_li_1 ul li').not(this).removeClass('on1')
        $(this).addClass('on1')
    })
    $(function(){
        var height1 = Number($('.on').find('ul li').length)*3+4;
        $('.on').animate({height:height1+'rem'},300)
    })
    
       
apiready = function() {
//分类名称的请求




   









 	var token = {
        do: 'get_type'
            };
        api.ajax({
            url: 'http://www.samlion.com/webApi/mk_app_type.php',
            method: 'get',
            "headers": {
                "Content-Type": "application/json"
            },
            dataType: "json",
            data: {
                body: token
            }
        }, function(ret, err) {
            // alert(JSON.stringify(ret));
            if (ret) {
                
                
                    var str ='<li class="nav_li_1" tapmode onclick="find(1)">'+
                             '<span>时尚美妆</span>'+
                             '<ul class="left_st">';
                     var str_1 ='<li class="nav_li_1" tapmode onclick="find(2)">'+
                             '<span>护肤</span>'+
                             '<ul class="left_st1">';         
                     var str_2 ='<li class="nav_li_1" tapmode onclick="find(3)">'+
                             '<span>个人护理</span>'+
                             '<ul class="left_st2">';
                     var str_3 ='<li class="nav_li_1" tapmode onclick="find(4)">'+
                             '<span>精品生活</span>'+
                             '<ul class="left_st3">';
                     var str_4 ='<li class="nav_li_1" tapmode onclick="find(5)">'+
                             '<span>超市</span>'+
                             '<ul class="left_st4">';
                     var str_5 ='<li class="nav_li_1" tapmode onclick="find(6)">'+
                             '<span>发现好货</span>'+
                             '<ul class="left_st5">';
                     
                    var str1 ='';
                     var str2='';
                     var str11='';
                     var str12='';
                     var str13='';
                     var str14='';
                     var str15='';
                     for(var tmp in ret['时尚美妆']){
                       
                          str1 +=  ' <li class="clissmz" >'+tmp+'</li>';
                           
                         }
                     for(var tmp in ret['护肤']){
                       
                        str11 +=  ' <li class="clihf">'+tmp+'</li>';
                        
                      }
                      for(var tmp in ret['个人护理']){
                       
                       str12 +=  ' <li class="cligrhl">'+tmp+'</li>';
                        
                      }
                      for(var tmp in ret['精品生活']){
                       
                       str13 +=  ' <li class="clijpsh">'+tmp+'</li>';
                        
                      }
                      for(var tmp in ret['超市']){
                       
                       str14 +=  ' <li class="clics">'+tmp+'</li>';
                        
                      }
                      for(var tmp in ret['发现好货']){
                       
                       str15 +=  ' <li class="clifxhh">'+tmp+'</li>';
                        
                      }
                    
                        str2=' </ul>'+
                        '</li>';
                     
                      var a_str =   str+str1+str2;
                      var a_str1 =   str_1+str11+str2;
                      var a_str_2 =   str_2+str12+str2;
                      var a_str_3 =   str_3+str13+str2;
                      var a_str_4 =   str_4+str14+str2;
                      var a_str_5 =   str_5+str15+str2;
                    $api.byId('left_nav').innerHTML+=a_str+ a_str1+a_str_2+a_str_3+a_str_4+a_str_5;



                    var one ="";
                    var type2= $api.getStorage('new_name');
                    if(type2==1){
                       var type='时尚美妆';
                    }else if(type2==2){
                        var type='护肤';
                    }else if(type2==3){
                        var type='个人护理';
                    }else if(type2==4){
                        var type='精品生活';
                    }else if(type2==5){
                        var type='超市';
                    }else if(type2==6){
                        var type='发现好货';
                    }
                    var type_1= $api.getStorage('new_type'); 
                    for(var j=0;j<ret[type][type_1].length;j++){
                      one += '<li class="lit-it">'+ret[type][type_1][j]['name']+'<input type="hidden" style="width:5%;height:100%;background-color:red;"value="'+ret[type][type_1][j]['id']+'"></li>'; 
                     
                    }
                    
                    $api.byId('top_api').innerHTML= one;
                    $api.byId('select_itme').innerHTML= one;
                  
                    

                  
 //获得id
        window.find = function (e){
           var c='';
                        if(e==1){
                            var c=119;
                    }else if(e==2){
                        var c=114;
                    }else if(e==3){
                        var c=132;
                    }else if(e==4){
                        var c=409;
                    }else if(e==5){
                        var c=15;
                    }else if(e==6){
                        var c=485;
                    }
                  ;
                    $api.setStorage('new_id',c);
                    getid();
                    }
                    $('body').on('click','.nav_li_1',function(){
                        var f_str=$(this).children('span').text();
                        // $api.setStorage('new_id', id);
                        if(f_str=='时尚美妆'){
                           var id=ret[f_str]['洗发护发'][0]['id'];
                           $api.setStorage('new_id', id);
                           
                        }else if(f_str=='护肤'){
                            var id=ret[f_str]['面部护肤'][0]['id'];
                            $api.setStorage('new_id', id);
                        }else if(f_str=='个人护理'){
                          var id=ret[f_str]['口腔护理'][0]['id'];
                          $api.setStorage('new_id', id);
                        }else if(f_str=='精品生活'){
                          var id=ret[f_str]['鲜花投递'][0]['id'];
                          $api.setStorage('new_id', id);
                        }else if(f_str=='超市'){
                         var  id=ret[f_str]['进口水果'][0]['id'];
                         $api.setStorage('new_id', id);
                        }else if(f_str=='发现好货'){
                           var id=ret[f_str]['营养健康'][0]['id'];
                           $api.setStorage('new_id', id);
                           getid();
                        }
                        })                       

                    $('body').on('click','.clifxhh',function(){
                    var thing=$(this).text();
                    //     var num=0;
                      var one='';
                    //     // alert(ret['发现好货'][thing].length);
                    for(var j=0;j<ret['发现好货'][thing].length;j++){
                      one += '<li class="lit-it">'+ret['发现好货'][thing][j]['name']+'<input type="hidden" style="width:0.001%;height:100%;"value="'+ret['发现好货'][thing][j]['id']+'"></li>';
                    }
                  
                    $api.byId('top_api').innerHTML= one;
                    
                    })       
                    $('body').on('click','.clissmz',function(){
                    var thing=$(this).text();
                    //     var num=0;
                      var one='';
                    //     // alert(ret['发现好货'][thing].length);
                    for(var j=0;j<ret['时尚美妆'][thing].length;j++){
                      one += '<li class="lit-it">'+ret['时尚美妆'][thing][j]['name']+'<input type="hidden"style="width:0.001%;height:100%;"value="'+ret['时尚美妆'][thing][j]['id']+'"></li>';
                    }
                  
                    $api.byId('top_api').innerHTML= one;
                    
                    $api.byId('select_itme').innerHTML= one;
                    })       
                    $('body').on('click','.clihf',function(){
                    var thing=$(this).text();
                    //     var num=0;
                      var one='';
                    //     // alert(ret['发现好货'][thing].length);
                    for(var j=0;j<ret['护肤'][thing].length;j++){
                      one += '<li class="lit-it">'+ret['护肤'][thing][j]['name']+'<input  type="hidden"style="width:0.001%;height:100%;"value="'+ret['护肤'][thing][j]['id']+'"></li>';
                    }
                  
                    $api.byId('top_api').innerHTML= one;
                    $api.byId('select_itme').innerHTML= one;
                    })       
                     $('body').on('click','.cligrhl',function(){
                    var thing=$(this).text();
                    //     var num=0;
                      var one='';
                    //     // alert(ret['发现好货'][thing].length);
                    for(var j=0;j<ret['个人护理'][thing].length;j++){
                      one += '<li class="lit-it">'+ret['个人护理'][thing][j]['name']+'<input type="hidden" style="width:0.001%;height:100%;"value="'+ret['个人护理'][thing][j]['id']+'"></li>';
                    }
                  
                    $api.byId('top_api').innerHTML= one;
                    $api.byId('select_itme').innerHTML= one;
                    })       
                    $('body').on('click','.clijpsh',function(){
                    var thing=$(this).text();
                    //     var num=0;
                      var one='';
                    //     // alert(ret['发现好货'][thing].length);
                    for(var j=0;j<ret['精品生活'][thing].length;j++){
                      one += '<li class="lit-it">'+ret['精品生活'][thing][j]['name']+'<input type="hidden"style="width:0.001%;height:100%;"value="'+ret['精品生活'][thing][j]['id']+'"></li>';
                    }
                  
                    $api.byId('top_api').innerHTML= one;
                    $api.byId('select_itme').innerHTML= one;
                    })       
                    $('body').on('click','.clics',function(){
                    var thing=$(this).text();
                    //     var num=0;
                      var one='';
                    //     // alert(ret['发现好货'][thing].length);
                    for(var j=0;j<ret['超市'][thing].length;j++){
                      one += '<li class="lit-it">'+ret['超市'][thing][j]['name']+'<input type="hidden" style="width:5%;height:100%;background-color:red;"value="'+ret['超市'][thing][j]['id']+'"></li>'; 
                     
                    }
                 
                    $api.byId('top_api').innerHTML= one;
                    $api.byId('select_itme').innerHTML= one;
                    })       
                 

                    // $api.addCls($api.byId('left_st').children(":first"), 'on1');
             }else {
                alert(JSON.stringify(err));
            }
        });
    







    //三级分类下的商品请求
        $('body').on('click','.lit-it',function(){
            var id=$(this).find('input').val();
            $api.setStorage('new_id', id);
      
            var id=$api.getStorage('new_id');
    var token = {
                do:'get_goods',
                type_id: id

            };
        api.ajax({
            url: 'http://www.samlion.com/webApi/mk_app_type.php',
            method: 'get',
            "headers": {
                "Content-Type": "application/json"
            },
            dataType: "json",
            data: {
                body: token
            }
        }, function(ret, err) {
            // alert(JSON.stringify(ret));
            if (ret) {
                $api.byId('content_box').innerHTML='';
                for(var i=0;i<=ret.length;i++){

                    $api.byId('content_box').innerHTML+= '<div class="item_box">'+
                   ' <div class="content_item">'+
                        '<div class="content_img"  ><img style=" " src="http://www.samlion.com/'+ret[i].original_img+'"></div>'+
                        '<div class="content_text_box">'+
                           ' <span class="content_title">'+ret[i].goods_name+'</span>'+
                            '<span class="content_price">￥'+ret[i].shop_price+'</span>'+
                            '<span class="content_num">'+ret[i].count+'人买过</span>'+
                       ' </div>'+
                   ' </div>'+
               '</div>'
               
                }
               

             }else {
                alert(JSON.stringify(err));
            }
        });
                   
    })       
//页面加载
    getid();
 function getid(){
    var id= $api.getStorage('new_id');
   
    $api.byId('content_box').innerHTML="";
 	
     var token = {
                 do:'get_goods',
                 type_id: id
 
             };
         api.ajax({
             url: 'http://www.samlion.com/webApi/mk_app_type.php',
             method: 'get',
             "headers": {
                 "Content-Type": "application/json"
             },
             dataType: "json",
             data: {
                 body: token
             }
         }, function(ret, err) {
             // alert(JSON.stringify(ret));
             if (ret) {
                 for(var i=0;i<=ret.length;i++){
 
             $api.byId('content_box').innerHTML+='  <div class="item_box">'+
                    ' <div class="content_item">'+
                        '<input type="hidden" value="'+ret[i].goods_id+'">'+
                         '<div class="content_img" ><img  src="http://www.samlion.com/'+ret[i].original_img+'"></div>'+
                         '<div class="content_text_box">'+
                            ' <span class="content_title">'+ret[i].goods_name+'</span>'+
                             '<span class="content_price">￥'+ret[i].shop_price+'</span>'+
                             '<span class="content_num">'+ret[i].count+'人买过</span>'+
                        ' </div>'+
                    ' </div>'+
                '</div>'
 
                 } 
                 
                   
              }else {
                 alert(JSON.stringify(err));
             }
         });
 }

     
        
    $('body').on('click','.content_item',function(){
       
       var ss=$(this).children('input').first().val();
       
       var uid =  $api.getStorage('uid')
     
  
       
           
       const url = 'http://www.samlion.com/mobile/goods.php?id='+ss+'name='+uid;
       
       api.openWin({
           name: 'type',
           url: 'mZhuang.html',
           pageParam: {
               url: url,
               // id: arr1[i],
               // token: token
           },
       });
       
   });
    }


</script>
</html>